<template>
  <div id="signin">
     <app-scroll class="content">
       <div class="wrap">
         <div class="title">
            <h3 @click="toback"> ＜ </h3>
            签到
          </div>
          <div class="content">
            <div class="tip">天天签到赢大奖</div>
            <div class="cal"><img src="img/cal.png" alt=""></div>
            <div class="continue">
              <span>已连续签到{{this.day}}</span>
              <i>连续签到7天即可享受奖励翻倍</i>
              <div class="line"><b ref="signin"></b></div>
              <div class="date">
                <li>1天</li>
                <li>2天</li>
                <li>3天</li>
                <li>4天</li>
                <li>5天</li>
                <li>6天</li>
                <li>7天</li>
              </div>
              <p @click.once="signinAction">签到</p>
            </div>
          </div>
       </div>
     </app-scroll>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      day: 3,
    };
  },
  methods: {
    async requestShopMsg() {
      const {
        data: { data },
      } = await axios.get("data/grade.json");
      // console.log(ms)
      this.goods = data;
    },
    toback(){
        this.$router.back();
    },
    signinAction(e){
      this.day++;
      var num = 16.6*(this.day-1) +"%"
      // console.log()
      this.$refs.signin.style.width = num;
      e.target.style.background = "#ddd"
    }
  },
  mounted() {
    this.requestShopMsg();
  },
};
</script>

<style lang="scss" scoped>
#signin {
  height:100%;
  width: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  
}
.content {
  height: 100%;
  width: 100%;
  
}
.wrap{
  background: url(/img/signin.jpg) no-repeat ;
  background-size: cover ;
  height: 862px;
  width:100%;
}
.title{
  height: 50px;
  text-align: center;
  line-height: 50px;
  font-size: 18px;
  color: #fff;
  position: relative;
  font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
  font-weight: 700;
  font-style: normal;
  color: #FFFFFF;
  h3{
    position: absolute;
    left: 20px;
  }
}
.content{
  display: flex;
  flex-direction: column;
  align-items: center;
  .tip{
    margin-top: 30px;
    font-family: '方正尚酷简体 Bold', '方正尚酷简体 Regular', '方正尚酷简体';
    font-weight: 700;
    font-style: normal;
    font-size: 40px;
    color: #F2F2F2;
    text-align: center;
  }
  .cal{
    text-align: center;
    margin-top: 20px;
    img{
      height: 90px;
      width: 90px;
    }
  }
}
.continue{
  width: 300px;
  height: 205px;
  background-color: rgba(255, 255, 255, 1);
  border: none;
  border-radius: 17px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 25px;
  box-sizing: border-box;
  span{
    font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
    font-weight: 700;
    font-style: normal;
    font-size: 16px;
    color: #434343;
    line-height: 32px;
  }
  i{
    font-size: 13px;
    color: #868686;
    line-height: 26px;
  }
  .line{
    width: 260px;
    height: 9px;
    background: inherit;
    background-color: rgba(37, 77, 66, 1);
    border-radius: 9px;
    margin-top: 30px;
    b{
      display: flex;
      width: 33.3%;
      height: 9px;
      border-radius: 9px;
      background: #21a775;
    }
   
  }
  .date{
    margin-top: 15px;
    width: 260px;
    display: flex;
    justify-content: space-between;
    color: #a1a1a1;
  }
  p{
      height: 30px;
      width: 90px;
      background: #21a775;
      text-align: center;
      margin-top: 15px;
      line-height: 30px;
      border-radius: 15px;
  }
}
</style>